﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;

public static class NavMeshExtension {

	public static Vector3 SampleNearestPositionOnWalkableNavMesh(Vector3 pos,float distance)
    {
        NavMeshHit nmhit;
        NavMesh.SamplePosition(pos, out nmhit, distance, 1);
        return nmhit.position;
        
    }
}
